package com.design.patterns.factorymethod;

import com.design.patterns.simplefactory.AbstractPay;

/**
 * @author jack
 * @version 1.0
 * @Package com.design.patterns.factorymethod
 * @Description:
 * @date 2021/6/9  21:16
 */
public class PayFactoryPattern {
    public static void main(String[] args) {
        PayFactory payFactory;
        AbstractPay abstractPay;
        payFactory = new CardPayFactory();
        abstractPay = payFactory.getPayMethod();
        abstractPay.pay();

        payFactory = new WeixinPayFactory();
        abstractPay = payFactory.getPayMethod();
        abstractPay.pay();

        payFactory = new AlipayPayFactory();
        abstractPay = payFactory.getPayMethod();
        abstractPay.pay();
    }
}
